package com.zhiwang.planet.ui.adapter

import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.zhiwang.planet.R
import com.zhiwang.planet.mvvm.model.entity.VipItem

class VipPrivilegeAdapter : RecyclerView.Adapter<VipPrivilegeAdapter.ItemViewHolder>() {

    var layoutInflater: LayoutInflater? = null

    var itemCounts: Int = 0
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    var privileges: List<VipItem> = arrayListOf()
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun onCreateViewHolder(parent: ViewGroup, p1: Int): ItemViewHolder {
        if (layoutInflater == null) {
            layoutInflater = LayoutInflater.from(parent.context)
        }
        return ItemViewHolder(layoutInflater!!.inflate(R.layout.item_vip_privilege_layout, parent, false))

    }


    override fun getItemCount() = privileges.size

    override fun onBindViewHolder(p0: ItemViewHolder, p1: Int) {

    }

    class ItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

    }
}